<?php

/**
 * @copyright Copyright 2012 CrApache-GUI
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * @license http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 */

function restart(){

    exec("httpd -k restart", $output, $return);
    $output = implode("\n", $output);

    echo $return. "<br />".$output;
}

function start(){

    exec("httpd -k start", $output, $return);
    $output = implode("\n", $output);

    echo $return. "<br />".$output;
}

function stop(){

    exec("httpd -k stop", $output, $return);
    $output = implode("\n", $output);

    echo $return. "<br />".$output;
}

function get_server_address(){

    return $_SERVER["SERVER_ADDR"];
}

function get_client_address(){

    return $_SERVER["REMOTE_ADDR"];
}

function is_server_running(){

    return true;
}

function get_server_time(){

    return date('Y-m-d H:i:s');
}

function get_server_name(){

    return $_SERVER["SERVER_SOFTWARE"];
}

?>
